<!DOCTYPE HTML>
<html lang="en">


<head>
    <meta charset="utf-8">
    <meta name="keywords" content="Springboot, Raki">
    <meta name="description" content="ERP模块现金融资获得现金，投资付出现金结束取回现金，支付融资利息。
st=&gt;start: 现金
op1=&gt;operation: 加工
cond=&gt;condition: 营运资本?
sub1=&gt;subroutine: 原料
sub2=&gt;su">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="renderer" content="webkit|ie-stand|ie-comp">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <title>Springboot | Raki</title>
    <link rel="icon" type="image/png" href="/3.png">

    <link rel="stylesheet" type="text/css" href="/libs/awesome/css/font-awesome.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/materialize/css/materialize.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/aos/aos.css">
    <link rel="stylesheet" type="text/css" href="/libs/animate/animate.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/lightGallery/css/lightgallery.min.css">
    <link rel="stylesheet" type="text/css" href="/css/matery.css">
    <link rel="stylesheet" type="text/css" href="/css/my.css">
    <style type="text/css">
        
    </style>

    <script src="/libs/jquery/jquery-2.2.0.min.js"></script>
<meta name="generator" content="Hexo 4.2.0"><link rel="stylesheet" href="/css/prism-tomorrow.css" type="text/css"></head>


<body>

<header class="navbar-fixed">
    <nav id="headNav" class="bg-color nav-transparent">
        <div id="navContainer" class="container">
            <div class="nav-wrapper">
                <div class="brand-logo">
                    <a href="/" class="waves-effect waves-light">
                        
                        <img src="/medias/6.png" class="logo-img hide-on-small-only">
                        
                        <span class="logo-span">Raki</span>
                    </a>
                </div>
                

<a href="#" data-activates="mobile-nav" class="button-collapse"><i class="fa fa-navicon"></i></a>
<ul class="right">
    
    <li class="hide-on-med-and-down">
        <a href="/" class="waves-effect waves-light">
            
            <i class="fa fa-home"></i>
            
            <span>Index</span>
        </a>
    </li>
    
    <li class="hide-on-med-and-down">
        <a href="/tags" class="waves-effect waves-light">
            
            <i class="fa fa-tags"></i>
            
            <span>Tags</span>
        </a>
    </li>
    
    <li class="hide-on-med-and-down">
        <a href="/categories" class="waves-effect waves-light">
            
            <i class="fa fa-bookmark"></i>
            
            <span>Categories</span>
        </a>
    </li>
    
    <li>
        <a id="toggleSearch" class="waves-effect waves-light">
            <i id="searchIcon" class="mdi-action-search" title="Search"></i>
        </a>
    </li>

</ul>

<div class="side-nav" id="mobile-nav">

    <div class="mobile-head bg-color">
        
        <img src="/medias/6.png" class="logo-img circle responsive-img">
        
        <div class="logo-name">Raki</div>
        <div class="logo-desc">
            
            You can create art and beauty on a computer
            
        </div>
    </div>

    

    <ul class="menu-list mobile-menu-list">
        
        <li>
            <a href="/" class="waves-effect waves-light">
                
                <i class="fa fa-fw fa-home"></i>
                
                Index
            </a>
        </li>
        
        <li>
            <a href="/tags" class="waves-effect waves-light">
                
                <i class="fa fa-fw fa-tags"></i>
                
                Tags
            </a>
        </li>
        
        <li>
            <a href="/categories" class="waves-effect waves-light">
                
                <i class="fa fa-fw fa-bookmark"></i>
                
                Categories
            </a>
        </li>
        
        
        <li><div class="divider"></div></li>
        <li>
            <a href="https://github.com/Raki0101" class="waves-effect waves-light" target="_blank">
                <i class="fa fa-github-square fa-fw"></i>Fork Me
            </a>
        </li>
        
    </ul>

    <div class="social-link">


    <a href="mailto:raki0101@163.com" class="tooltipped" target="_blank" data-tooltip="邮件联系我" data-position="top" data-delay="50">
        <i class="fa fa-envelope-open"></i>
    </a>



    <a href="tencent://AddContact/?fromId=50&fromSubId=1&subcmd=all&uin=1460267552" class="tooltipped" data-tooltip="QQ联系我: 1460267552" data-position="top" data-delay="50">
        <i class="fa fa-qq"></i>
    </a>


</div>
</div>

            </div>
        </div>

        
        <style>
    .nav-transparent .github-corner {
        display: none !important;
    }

    .github-corner {
        position: absolute;
        z-index: 10;
        top: 0;
        right: 0;
        border: 0;
        transform: scale(1.1);
    }

    .github-corner svg {
        color: #0f9d58;
        fill: #fff;
        height: 64px;
        width: 64px;
    }

    .github-corner:hover .octo-arm {
        animation: a 0.56s ease-in-out;
    }

    .github-corner .octo-arm {
        animation: none;
    }

    @keyframes a {
        0%,
        to {
            transform: rotate(0);
        }
        20%,
        60% {
            transform: rotate(-25deg);
        }
        40%,
        80% {
            transform: rotate(10deg);
        }
    }
</style>

<a href="https://github.com/Raki0101" class="github-corner tooltipped hide-on-med-and-down" target="_blank"
   data-tooltip="Fork Me" data-position="left" data-delay="50">
    <svg viewBox="0 0 250 250" aria-hidden="true">
        <path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
        <path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
              fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>
        <path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
              fill="currentColor" class="octo-body"></path>
    </svg>
</a>
        
    </nav>
</header>


<script src="/libs/cryptojs/crypto-js.min.js"></script>
<script>
    (function() {
        let pwd = 'hello';
        if (pwd && pwd.length > 0) {
            if (pwd !== CryptoJS.SHA256(prompt('请输入访问本文章的密码')).toString(CryptoJS.enc.Hex)) {
                alert('密码错误，将返回主页！');
                location.href = '/';
            }
        }
    })();
</script>




<div class="bg-cover post-cover" style="background-image: url('/medias/featureimages/15.jpg')">
    <div class="container">
        <div class="row">
            <div class="col s12 m12 l12">
                <div class="brand">
                    <div class="description center-align post-title">
                        Springboot
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>



<main class="post-container content">

    
    <link rel="stylesheet" href="/libs/tocbot/tocbot.css">
<style>
    #articleContent h1::before,
    #articleContent h2::before,
    #articleContent h3::before,
    #articleContent h4::before,
    #articleContent h5::before,
    #articleContent h6::before {
        display: block;
        content: " ";
        height: 100px;
        margin-top: -100px;
        visibility: hidden;
    }

    #articleContent :focus {
        outline: none;
    }

    .toc-fixed {
        position: fixed;
        top: 64px;
    }

    .toc-widget {
        padding-left: 20px;
    }

    .toc-widget .toc-title {
        margin: 35px 0 15px 0;
        padding-left: 17px;
        font-size: 1.5rem;
        font-weight: bold;
        line-height: 1.5rem;
    }

    .toc-widget ol {
        padding: 0;
        list-style: none;
    }

    #toc-content ol {
        padding-left: 10px;
    }

    #toc-content ol li {
        padding-left: 10px;
    }

    #toc-content .toc-link:hover {
        color: #42b983;
        font-weight: 700;
        text-decoration: underline;
    }

    #toc-content .toc-link::before {
        background-color: transparent;
        max-height: 25px;
    }

    #toc-content .is-active-link {
        color: #42b983;
    }

    #toc-content .is-active-link::before {
        background-color: #42b983;
    }
</style>
<div class="row">
    <div class="col s12 m12 l9">
        <!-- 文章内容详情 -->
<div id="artDetail">
    <div class="card">
        <div class="card-content article-info">
            <div class="row tag-cate">
                <div class="col s7">
                    
                    <div class="article-tag">
                        
                            <a href="/tags/Java/" target="_blank">
                                <span class="chip bg-color">Java</span>
                            </a>
                        
                    </div>
                    
                </div>
                <div class="col s5 right-align">
                    
                </div>
            </div>

            <div class="post-info">
                <div class="post-date info-break-policy">
                    <i class="fa fa-calendar-minus-o fa-fw"></i>Publish Date:&nbsp;&nbsp;
                    2020-02-24
                </div>

                
                    
                    <div class="info-break-policy">
                        <i class="fa fa-file-word-o fa-fw"></i>Word Count:&nbsp;&nbsp;
                        1.8k
                    </div>
                    

                    
                    <div class="info-break-policy">
                        <i class="fa fa-clock-o fa-fw"></i>Read Times:&nbsp;&nbsp;
                        9 Min
                    </div>
                    
                
				
				
                    <div id="busuanzi_container_page_pv" class="info-break-policy">
                        <i class="fa fa-eye fa-fw"></i>Read Count:&nbsp;&nbsp;
                        <span id="busuanzi_value_page_pv"></span>
                    </div>
				
            </div>
        </div>
        <hr class="clearfix">
        <div class="card-content article-card-content">
            <div id="articleContent">
                <h1 id="ERP"><a href="#ERP" class="headerlink" title="ERP"></a>ERP</h1><h2 id="模块"><a href="#模块" class="headerlink" title="模块"></a>模块</h2><p>现金<br>融资获得现金，投资付出现金结束取回现金，支付融资利息。</p>
<pre class=" language-flow"><code class="language-flow">st=>start: 现金
op1=>operation: 加工
cond=>condition: 营运资本?
sub1=>subroutine: 原料
sub2=>subroutine: 厂房\生产线\研发\开发
sub3=>subroutine: 成品
op2=>operation: 广告选单
sub4=>subroutine: 销售变现并还钱

st->cond
cond(yes)->sub1
cond(no)->sub2
sub1->op1
op1->sub3
sub3->op2
op2->sub4
sub4->cond
</code></pre>
<h3 id="财务报表"><a href="#财务报表" class="headerlink" title="财务报表"></a>财务报表</h3><p>会计科目 会计凭证 报表（利润表和资产负债表）</p>
<pre><code>会计凭证记录一笔业务的发生，再由日记账汇总到总账，期末结转。</code></pre><h3 id="筹资"><a href="#筹资" class="headerlink" title="筹资"></a>筹资</h3><p>贷款类型 长期贷款 短期贷款 高利贷</p>
<h3 id="长期投资"><a href="#长期投资" class="headerlink" title="长期投资"></a>长期投资</h3><h3 id="物料管理"><a href="#物料管理" class="headerlink" title="物料管理"></a>物料管理</h3><p>原料管理 存货管理</p>
<h3 id="厂房"><a href="#厂房" class="headerlink" title="厂房"></a>厂房</h3><p>厂房类型 厂房情况</p>
<h3 id="生产线"><a href="#生产线" class="headerlink" title="生产线"></a>生产线</h3><p>生产线种类 生产线情况 生产情况</p>
<h3 id="市场销售"><a href="#市场销售" class="headerlink" title="市场销售"></a>市场销售</h3><p>订单管理</p>
<h3 id="贷款"><a href="#贷款" class="headerlink" title="贷款"></a>贷款</h3><p>entity必有Id CreateTime CreateUser EditTime EditUser</p>
<p>另外：group_id:1000</p>
<p>team_count： yang</p>
<h2 id="贷款-长期贷款为例"><a href="#贷款-长期贷款为例" class="headerlink" title="贷款-长期贷款为例"></a>贷款-长期贷款为例</h2><h3 id="长期贷款显示"><a href="#长期贷款显示" class="headerlink" title="长期贷款显示"></a>长期贷款显示</h3><pre class=" language-javascript"><code class="language-javascript">$<span class="token punctuation">.</span><span class="token function">ajax</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
        type<span class="token punctuation">:</span> <span class="token string">"post"</span><span class="token punctuation">,</span>
        dataType<span class="token punctuation">:</span> <span class="token string">"json"</span><span class="token punctuation">,</span>
        data<span class="token punctuation">:</span> <span class="token punctuation">{</span>pageSize<span class="token punctuation">:</span> <span class="token number">100</span><span class="token punctuation">,</span> pageNum<span class="token punctuation">:</span> <span class="token number">0</span><span class="token punctuation">}</span><span class="token punctuation">,</span>
        url<span class="token punctuation">:</span> <span class="token string">"/LongTermLoans/listbyuserandperiod"</span><span class="token punctuation">,</span>
        contentType<span class="token punctuation">:</span> <span class="token string">"application/json;charset=utf-8;"</span><span class="token punctuation">,</span>
success<span class="token punctuation">:</span> <span class="token keyword">function</span> <span class="token punctuation">(</span>data<span class="token punctuation">)</span> <span class="token punctuation">{</span>
    data <span class="token operator">=</span> data<span class="token punctuation">[</span><span class="token string">'data'</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
    $<span class="token punctuation">.</span><span class="token function">each</span><span class="token punctuation">(</span>data<span class="token punctuation">,</span> <span class="token keyword">function</span> <span class="token punctuation">(</span>n<span class="token punctuation">,</span> value<span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token keyword">var</span> i <span class="token operator">=</span> <span class="token number">6</span> <span class="token operator">-</span> <span class="token punctuation">(</span><span class="token punctuation">(</span>value<span class="token punctuation">.</span>returnTime <span class="token operator">-</span> <span class="token number">1</span><span class="token punctuation">)</span> <span class="token operator">/</span> <span class="token number">4</span><span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment" spellcheck="true">//i 计算长期贷款显示的位置</span>
        console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token function">$</span><span class="token punctuation">(</span><span class="token string">"#ceo-cz-c"</span> <span class="token operator">+</span> i<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">val</span><span class="token punctuation">(</span>value<span class="token punctuation">.</span>moneyTotal<span class="token punctuation">)</span><span class="token punctuation">;</span><span class="token comment" spellcheck="true">//val()设定文本框的值 </span>
         <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
         <span class="token punctuation">}</span>
    <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
<ol>
<li><p>i 计算长期贷款显示的位置</p>
</li>
<li><p>val()设定文本框的值为 data第一条数据中moneyTotal的值<br>不是很清楚<strong><em>n</em></strong>的用途</p>
<h3 id="用户点击事件确认长贷"><a href="#用户点击事件确认长贷" class="headerlink" title="用户点击事件确认长贷"></a>用户点击事件确认长贷</h3><pre class=" language-javascript"><code class="language-javascript"><span class="token function">$</span><span class="token punctuation">(</span><span class="token string">"#pop-ok"</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">click</span><span class="token punctuation">(</span><span class="token keyword">function</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>

</code></pre>
</li>
</ol>
<pre><code> var LongTermLoans = {
        moneyTotal:$(&#39;#load-c&#39;).val(),
        period: $(&#39;#currentAp&#39;).val()

    };
  $.ajax({
        type: &quot;post&quot;,
        dataType: &quot;json&quot;,
        url: &quot;/LongTermLoans/add&quot;,
        contentType: &quot;application/json;charset=utf-8;&quot;,
        data: JSON.stringify(LongTermLoans),
        success: function (data) {
            alert(&quot;长期贷款成功&quot;);
        $(&#39;#cash&#39;).text(parseInt($(&#39;#load-c&#39;).val()) + parseInt($(&#39;#cash&#39;).text()));//财务显示更新
        }
    })
    $(&quot;#ceo-cz-c1&quot;).val($(&#39;#load-c&#39;).val());//覆盖原来的值为（input文本框 id=load-c）的值
});</code></pre><pre><code>
cash显示在财务部的现金值为 （input文本框 id=load-c）的值 加上 原来的值
覆盖原来的值为（input文本框 id=load-c）的值

后端长贷数据按TeamCount显示到前端

```java
//LongTermLoansController:
@RequestMapping(&quot;listbyuserandperiod&quot;)
public String getByUserIdAndPeriod() {
    //获得当前用户period 和 userteam
    String userTeam = Jurisdiction.getUserTeam();
    int period = Integer.parseInt(Jurisdiction.getUserTeamintPeriod());

    return success(LongTermLoansService.getByUserTeamIdAndPeriod(userTeam));
}
//LongTermLoansService:
List&lt;LongTermLoans&gt; getByUserTeamIdAndPeriod(String userTeam);
// LongTermLoansServiceImpl:
 @Override
    public List&lt;LongTermLoans&gt; getByUserTeamIdAndPeriod(String userTeam ) {
        Example example = new Example(LongTermLoans.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo(&quot;teamCount&quot;, userTeam);
        return LongTermLoansMapper.selectByExample(example);
</code></pre><p>总结起来就是，选出存储在数据库里与当前userTeam相同的数据。</p>
<h3 id="长贷的add方法"><a href="#长贷的add方法" class="headerlink" title="长贷的add方法"></a>长贷的add方法</h3><p>每一次add 都将插入一组数据，同时以判断”teamCount””period”来删除相同区间内的一笔业务</p>
<p>并生成凭证。</p>
<pre class=" language-java"><code class="language-java"><span class="token keyword">public</span> <span class="token keyword">void</span> <span class="token function">add</span><span class="token punctuation">(</span>LongTermLoans LongTermLoans<span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token comment" spellcheck="true">//全局变量 写入当前公司或小组ID</span>
    String userTeam <span class="token operator">=</span> Jurisdiction<span class="token punctuation">.</span><span class="token function">getUserTeam</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment" spellcheck="true">//获取当前userTeam</span>
    <span class="token comment" spellcheck="true">//补充相关字段的取值</span>
    LongTermLoans<span class="token punctuation">.</span><span class="token function">setTeamCount</span><span class="token punctuation">(</span>userTeam<span class="token punctuation">)</span><span class="token punctuation">;</span>
    LongTermLoans<span class="token punctuation">.</span><span class="token function">setGroupId</span><span class="token punctuation">(</span><span class="token string">"1000"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    LongTermLoans<span class="token punctuation">.</span><span class="token function">setReturnTime</span><span class="token punctuation">(</span>LongTermLoans<span class="token punctuation">.</span><span class="token function">getPeriod</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">+</span><span class="token number">20</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token comment" spellcheck="true">//删除当前长贷记录</span>
    Example example <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Example</span><span class="token punctuation">(</span>LongTermLoans<span class="token punctuation">.</span><span class="token keyword">class</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    Example<span class="token punctuation">.</span>Criteria criteria <span class="token operator">=</span> example<span class="token punctuation">.</span><span class="token function">createCriteria</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    criteria<span class="token punctuation">.</span><span class="token function">andEqualTo</span><span class="token punctuation">(</span><span class="token string">"teamCount"</span><span class="token punctuation">,</span> LongTermLoans<span class="token punctuation">.</span><span class="token function">getTeamCount</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    criteria<span class="token punctuation">.</span><span class="token function">andEqualTo</span><span class="token punctuation">(</span><span class="token string">"period"</span><span class="token punctuation">,</span> LongTermLoans<span class="token punctuation">.</span><span class="token function">getPeriod</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token comment" spellcheck="true">//select * from LongTermLoans where "teamCount"  = LongTermLoans.getTeamCount() and  period= LongTermLoans.getPeriod()</span>
    List<span class="token operator">&lt;</span>LongTermLoans<span class="token operator">></span> oldRow <span class="token operator">=</span> LongTermLoansMapper<span class="token punctuation">.</span><span class="token function">selectByExample</span><span class="token punctuation">(</span>example<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token keyword">if</span><span class="token punctuation">(</span>oldRow<span class="token punctuation">.</span><span class="token function">size</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">></span> <span class="token number">0</span><span class="token punctuation">)</span>
        <span class="token punctuation">{</span>
            LongTermLoansMapper<span class="token punctuation">.</span><span class="token function">deleteByExample</span><span class="token punctuation">(</span>example<span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>

    <span class="token comment" spellcheck="true">//提交新增记录，自动生成GUID主键及新增的createuser ,createtime</span>
    BaseBeanHelper<span class="token punctuation">.</span><span class="token function">insert</span><span class="token punctuation">(</span>LongTermLoans<span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment" spellcheck="true">//自动插入createuser ,createtime edituser edittime</span>
    LongTermLoansMapper<span class="token punctuation">.</span><span class="token function">insert</span><span class="token punctuation">(</span>LongTermLoans<span class="token punctuation">)</span><span class="token punctuation">;</span>

    <span class="token comment" spellcheck="true">//自动生成长贷会计凭证</span>
    accountingVoucherService<span class="token punctuation">.</span><span class="token function">voucherMaker</span><span class="token punctuation">(</span>userTeam<span class="token punctuation">,</span>LongTermLoans<span class="token punctuation">.</span><span class="token function">getPeriod</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span>LongTermLoans<span class="token punctuation">.</span><span class="token function">getMoneyTotal</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token string">"CHANGDAI"</span><span class="token punctuation">,</span><span class="token string">"新增长贷"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
</code></pre>
<h2 id="会计凭证"><a href="#会计凭证" class="headerlink" title="会计凭证"></a>会计凭证</h2><p>长贷调用方法。</p>
<pre class=" language-java"><code class="language-java"><span class="token comment" spellcheck="true">//自动生成长贷会计凭证</span>
    accountingVoucherService<span class="token punctuation">.</span><span class="token function">voucherMaker</span><span class="token punctuation">(</span>userTeam<span class="token punctuation">,</span>LongTermLoans<span class="token punctuation">.</span><span class="token function">getPeriod</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span>LongTermLoans<span class="token punctuation">.</span><span class="token function">getMoneyTotal</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token string">"CHANGDAI"</span><span class="token punctuation">,</span><span class="token string">"新增长贷"</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
<p>自动记账-调用插入借贷</p>
<pre class=" language-java"><code class="language-java"> <span class="token keyword">public</span> <span class="token keyword">void</span> <span class="token function">voucherMaker</span><span class="token punctuation">(</span>String teamCount<span class="token punctuation">,</span> <span class="token keyword">int</span> period <span class="token punctuation">,</span> BigDecimal amount<span class="token punctuation">,</span> String voucherType<span class="token punctuation">,</span>String content<span class="token punctuation">)</span> <span class="token punctuation">{</span>
        Example example <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Example</span><span class="token punctuation">(</span>AccountingVoucher<span class="token punctuation">.</span><span class="token keyword">class</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        Example<span class="token punctuation">.</span>Criteria criteria <span class="token operator">=</span> example<span class="token punctuation">.</span><span class="token function">createCriteria</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token keyword">switch</span> <span class="token punctuation">(</span>voucherType<span class="token punctuation">)</span>
        <span class="token punctuation">{</span>
           <span class="token keyword">case</span> <span class="token string">"CHANGDAI"</span><span class="token operator">:</span>  <span class="token comment" spellcheck="true">//长贷的自动会计分录</span>
               <span class="token function">voucherMakerBase</span><span class="token punctuation">(</span>teamCount<span class="token punctuation">,</span>period<span class="token punctuation">,</span><span class="token string">"现金"</span><span class="token punctuation">,</span><span class="token string">"长期负债"</span><span class="token punctuation">,</span>amount<span class="token punctuation">,</span>content<span class="token punctuation">)</span><span class="token punctuation">;</span>
               <span class="token keyword">break</span><span class="token punctuation">;</span>
           <span class="token keyword">case</span> <span class="token string">"DUANDAI"</span><span class="token operator">:</span>  <span class="token comment" spellcheck="true">//短贷的会计分录</span>
               <span class="token function">voucherMakerBase</span><span class="token punctuation">(</span>teamCount<span class="token punctuation">,</span>period<span class="token punctuation">,</span><span class="token string">"现金"</span><span class="token punctuation">,</span><span class="token string">"短期负债"</span><span class="token punctuation">,</span>amount<span class="token punctuation">,</span>content<span class="token punctuation">)</span><span class="token punctuation">;</span>
               <span class="token keyword">break</span><span class="token punctuation">;</span>
     <span class="token punctuation">}</span>
    <span class="token punctuation">}</span>
<span class="token punctuation">}</span>
</code></pre>
<p>插入借贷</p>
<pre class=" language-java"><code class="language-java"><span class="token keyword">private</span>  <span class="token keyword">void</span>  <span class="token function">voucherMakerBase</span><span class="token punctuation">(</span>String teamCount<span class="token punctuation">,</span> <span class="token keyword">int</span> period <span class="token punctuation">,</span>String debtAcount<span class="token punctuation">,</span>String CreditAcount<span class="token punctuation">,</span> BigDecimal amount<span class="token punctuation">,</span>String content<span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    <span class="token comment" spellcheck="true">//删除已有分录按(teamCount period substract)</span>
    Example example <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Example</span><span class="token punctuation">(</span>AccountingVoucher<span class="token punctuation">.</span><span class="token keyword">class</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    Example<span class="token punctuation">.</span>Criteria criteria <span class="token operator">=</span> example<span class="token punctuation">.</span><span class="token function">createCriteria</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    criteria<span class="token punctuation">.</span><span class="token function">andEqualTo</span><span class="token punctuation">(</span><span class="token string">"teamCount"</span><span class="token punctuation">,</span>teamCount<span class="token punctuation">)</span><span class="token punctuation">;</span>
    criteria<span class="token punctuation">.</span><span class="token function">andEqualTo</span><span class="token punctuation">(</span><span class="token string">"period"</span><span class="token punctuation">,</span> period<span class="token punctuation">)</span><span class="token punctuation">;</span>
    criteria<span class="token punctuation">.</span><span class="token function">andEqualTo</span><span class="token punctuation">(</span><span class="token string">"substract"</span><span class="token punctuation">,</span> content<span class="token punctuation">)</span><span class="token punctuation">;</span>
    List<span class="token operator">&lt;</span>AccountingVoucher<span class="token operator">></span> oldRow1 <span class="token operator">=</span> AccountingVoucherMapper<span class="token punctuation">.</span><span class="token function">selectByExample</span><span class="token punctuation">(</span>example<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token keyword">if</span><span class="token punctuation">(</span>oldRow1<span class="token punctuation">.</span><span class="token function">size</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">></span> <span class="token number">0</span><span class="token punctuation">)</span>
    <span class="token punctuation">{</span>
        AccountingVoucherMapper<span class="token punctuation">.</span><span class="token function">deleteByExample</span><span class="token punctuation">(</span>example<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>
    <span class="token comment" spellcheck="true">//插入会计分录-借方</span>
    AccountingVoucher vd1 <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">AccountingVoucher</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    vd1<span class="token punctuation">.</span><span class="token function">setTeamCount</span><span class="token punctuation">(</span>teamCount<span class="token punctuation">)</span><span class="token punctuation">;</span>
    vd1<span class="token punctuation">.</span><span class="token function">setPeriod</span><span class="token punctuation">(</span>period<span class="token punctuation">)</span><span class="token punctuation">;</span>
    vd1<span class="token punctuation">.</span><span class="token function">setSubstract</span><span class="token punctuation">(</span>content<span class="token punctuation">)</span><span class="token punctuation">;</span>
    vd1<span class="token punctuation">.</span><span class="token function">setAcode</span><span class="token punctuation">(</span>debtAcount<span class="token punctuation">)</span><span class="token punctuation">;</span>
    vd1<span class="token punctuation">.</span><span class="token function">setAname</span><span class="token punctuation">(</span>debtAcount<span class="token punctuation">)</span><span class="token punctuation">;</span>
    vd1<span class="token punctuation">.</span><span class="token function">setMoneyD</span><span class="token punctuation">(</span>amount<span class="token punctuation">)</span><span class="token punctuation">;</span>
    BaseBeanHelper<span class="token punctuation">.</span><span class="token function">insert</span><span class="token punctuation">(</span>vd1<span class="token punctuation">)</span><span class="token punctuation">;</span>
    AccountingVoucherMapper<span class="token punctuation">.</span><span class="token function">insert</span><span class="token punctuation">(</span>vd1<span class="token punctuation">)</span><span class="token punctuation">;</span>
     <span class="token comment" spellcheck="true">//插入会计分录-贷方</span>
    AccountingVoucher vc1 <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">AccountingVoucher</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    vc1<span class="token punctuation">.</span><span class="token function">setTeamCount</span><span class="token punctuation">(</span>teamCount<span class="token punctuation">)</span><span class="token punctuation">;</span>
    vc1<span class="token punctuation">.</span><span class="token function">setPeriod</span><span class="token punctuation">(</span>period<span class="token punctuation">)</span><span class="token punctuation">;</span>
    vc1<span class="token punctuation">.</span><span class="token function">setSubstract</span><span class="token punctuation">(</span>content<span class="token punctuation">)</span><span class="token punctuation">;</span>
    vc1<span class="token punctuation">.</span><span class="token function">setAcode</span><span class="token punctuation">(</span>CreditAcount<span class="token punctuation">)</span><span class="token punctuation">;</span>
    vc1<span class="token punctuation">.</span><span class="token function">setAname</span><span class="token punctuation">(</span>CreditAcount<span class="token punctuation">)</span><span class="token punctuation">;</span>
    vc1<span class="token punctuation">.</span><span class="token function">setMoneyC</span><span class="token punctuation">(</span>amount<span class="token punctuation">)</span><span class="token punctuation">;</span>
    BaseBeanHelper<span class="token punctuation">.</span><span class="token function">insert</span><span class="token punctuation">(</span>vc1<span class="token punctuation">)</span><span class="token punctuation">;</span>
    AccountingVoucherMapper<span class="token punctuation">.</span><span class="token function">insert</span><span class="token punctuation">(</span>vc1<span class="token punctuation">)</span><span class="token punctuation">;</span>

<span class="token punctuation">}</span></code></pre>
<h2 id="利润表"><a href="#利润表" class="headerlink" title="利润表"></a>利润表</h2><pre class=" language-java"><code class="language-java"><span class="token keyword">public</span> <span class="token keyword">void</span> <span class="token function">transferProfitAndLoss</span><span class="token punctuation">(</span>String teamCount<span class="token punctuation">,</span> <span class="token keyword">int</span> period<span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token comment" spellcheck="true">//</span>
    List<span class="token operator">&lt;</span>AccountBalance<span class="token operator">></span>  mylist <span class="token operator">=</span> accountBalanceService<span class="token punctuation">.</span><span class="token function">getByTeamcountAndPeriod</span><span class="token punctuation">(</span>teamCount<span class="token punctuation">,</span>period<span class="token punctuation">)</span><span class="token punctuation">;</span>

    <span class="token keyword">for</span><span class="token punctuation">(</span><span class="token keyword">int</span> i<span class="token operator">=</span><span class="token number">0</span> <span class="token punctuation">;</span>i<span class="token operator">&lt;</span>mylist<span class="token punctuation">.</span><span class="token function">size</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>i<span class="token operator">++</span><span class="token punctuation">)</span>
    <span class="token punctuation">{</span>
        String myCode <span class="token operator">=</span> mylist<span class="token punctuation">.</span><span class="token function">get</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">getAcode</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        BigDecimal myMoneyC <span class="token operator">=</span>  mylist<span class="token punctuation">.</span><span class="token function">get</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">getMoneyC</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment" spellcheck="true">//贷方金额</span>
        BigDecimal myMoneyD <span class="token operator">=</span>  mylist<span class="token punctuation">.</span><span class="token function">get</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">getMoneyD</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span> <span class="token comment" spellcheck="true">//借方金额</span>
        String content <span class="token operator">=</span><span class="token string">"期间损益结转"</span><span class="token punctuation">;</span>

        BigDecimal  netMoney <span class="token operator">=</span> BigDecimal<span class="token punctuation">.</span><span class="token function">valueOf</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        BigDecimal  taxMoney <span class="token operator">=</span> BigDecimal<span class="token punctuation">.</span><span class="token function">valueOf</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

<span class="token comment" spellcheck="true">//销售收入 其他收入 直接成本 综合费用 其他支出 折旧</span>
        <span class="token keyword">switch</span><span class="token punctuation">(</span>myCode<span class="token punctuation">)</span>
        <span class="token punctuation">{</span>
            <span class="token keyword">case</span> <span class="token string">"销售收入"</span><span class="token operator">:</span>
                AccountingVoucher vd4 <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">AccountingVoucher</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                vd4<span class="token punctuation">.</span><span class="token function">setTeamCount</span><span class="token punctuation">(</span>teamCount<span class="token punctuation">)</span><span class="token punctuation">;</span>
                vd4<span class="token punctuation">.</span><span class="token function">setPeriod</span><span class="token punctuation">(</span>period<span class="token punctuation">)</span><span class="token punctuation">;</span>
                vd4<span class="token punctuation">.</span><span class="token function">setSubstract</span><span class="token punctuation">(</span>content<span class="token punctuation">)</span><span class="token punctuation">;</span>
                vd4<span class="token punctuation">.</span><span class="token function">setAcode</span><span class="token punctuation">(</span>myCode<span class="token punctuation">)</span><span class="token punctuation">;</span>
                vd4<span class="token punctuation">.</span><span class="token function">setAname</span><span class="token punctuation">(</span>myCode<span class="token punctuation">)</span><span class="token punctuation">;</span>
                vd4<span class="token punctuation">.</span><span class="token function">setMoneyD</span><span class="token punctuation">(</span>myMoneyC<span class="token punctuation">)</span><span class="token punctuation">;</span>
                vd4<span class="token punctuation">.</span><span class="token function">setMoneyC</span><span class="token punctuation">(</span>BigDecimal<span class="token punctuation">.</span><span class="token function">valueOf</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                BaseBeanHelper<span class="token punctuation">.</span><span class="token function">insert</span><span class="token punctuation">(</span>vd4<span class="token punctuation">)</span><span class="token punctuation">;</span>
                AccountingVoucherMapper<span class="token punctuation">.</span><span class="token function">insert</span><span class="token punctuation">(</span>vd4<span class="token punctuation">)</span><span class="token punctuation">;</span>
                netMoney<span class="token operator">=</span> netMoney<span class="token punctuation">.</span><span class="token function">add</span><span class="token punctuation">(</span>myMoneyC<span class="token punctuation">)</span><span class="token punctuation">;</span>
                <span class="token keyword">break</span><span class="token punctuation">;</span>
            <span class="token keyword">case</span> <span class="token string">"其它收入"</span><span class="token operator">:</span>
                AccountingVoucher vd5 <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">AccountingVoucher</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                vd5<span class="token punctuation">.</span><span class="token function">setTeamCount</span><span class="token punctuation">(</span>teamCount<span class="token punctuation">)</span><span class="token punctuation">;</span>
                vd5<span class="token punctuation">.</span><span class="token function">setPeriod</span><span class="token punctuation">(</span>period<span class="token punctuation">)</span><span class="token punctuation">;</span>
                vd5<span class="token punctuation">.</span><span class="token function">setSubstract</span><span class="token punctuation">(</span>content<span class="token punctuation">)</span><span class="token punctuation">;</span>
                vd5<span class="token punctuation">.</span><span class="token function">setAcode</span><span class="token punctuation">(</span>myCode<span class="token punctuation">)</span><span class="token punctuation">;</span>
                vd5<span class="token punctuation">.</span><span class="token function">setAname</span><span class="token punctuation">(</span>myCode<span class="token punctuation">)</span><span class="token punctuation">;</span>
                vd5<span class="token punctuation">.</span><span class="token function">setMoneyD</span><span class="token punctuation">(</span>myMoneyC<span class="token punctuation">)</span><span class="token punctuation">;</span>
                vd5<span class="token punctuation">.</span><span class="token function">setMoneyC</span><span class="token punctuation">(</span>BigDecimal<span class="token punctuation">.</span><span class="token function">valueOf</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                BaseBeanHelper<span class="token punctuation">.</span><span class="token function">insert</span><span class="token punctuation">(</span>vd5<span class="token punctuation">)</span><span class="token punctuation">;</span>
                AccountingVoucherMapper<span class="token punctuation">.</span><span class="token function">insert</span><span class="token punctuation">(</span>vd5<span class="token punctuation">)</span><span class="token punctuation">;</span>
                netMoney<span class="token operator">=</span> netMoney<span class="token punctuation">.</span><span class="token function">add</span><span class="token punctuation">(</span>myMoneyC<span class="token punctuation">)</span><span class="token punctuation">;</span>
                <span class="token keyword">break</span><span class="token punctuation">;</span>
            <span class="token keyword">case</span> <span class="token string">"直接成本"</span><span class="token operator">:</span>
            AccountingVoucher vd1 <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">AccountingVoucher</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            vd1<span class="token punctuation">.</span><span class="token function">setTeamCount</span><span class="token punctuation">(</span>teamCount<span class="token punctuation">)</span><span class="token punctuation">;</span>
            vd1<span class="token punctuation">.</span><span class="token function">setPeriod</span><span class="token punctuation">(</span>period<span class="token punctuation">)</span><span class="token punctuation">;</span>
            vd1<span class="token punctuation">.</span><span class="token function">setSubstract</span><span class="token punctuation">(</span>content<span class="token punctuation">)</span><span class="token punctuation">;</span>
            vd1<span class="token punctuation">.</span><span class="token function">setAcode</span><span class="token punctuation">(</span>myCode<span class="token punctuation">)</span><span class="token punctuation">;</span>
            vd1<span class="token punctuation">.</span><span class="token function">setAname</span><span class="token punctuation">(</span>myCode<span class="token punctuation">)</span><span class="token punctuation">;</span>
            vd1<span class="token punctuation">.</span><span class="token function">setMoneyD</span><span class="token punctuation">(</span>BigDecimal<span class="token punctuation">.</span><span class="token function">valueOf</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            vd1<span class="token punctuation">.</span><span class="token function">setMoneyC</span><span class="token punctuation">(</span>myMoneyD<span class="token punctuation">)</span><span class="token punctuation">;</span>
            BaseBeanHelper<span class="token punctuation">.</span><span class="token function">insert</span><span class="token punctuation">(</span>vd1<span class="token punctuation">)</span><span class="token punctuation">;</span>
            AccountingVoucherMapper<span class="token punctuation">.</span><span class="token function">insert</span><span class="token punctuation">(</span>vd1<span class="token punctuation">)</span><span class="token punctuation">;</span>
                netMoney<span class="token operator">=</span> netMoney<span class="token punctuation">.</span><span class="token function">subtract</span><span class="token punctuation">(</span>myMoneyD<span class="token punctuation">)</span><span class="token punctuation">;</span>
                <span class="token keyword">break</span><span class="token punctuation">;</span>
            <span class="token keyword">case</span> <span class="token string">"综合费用"</span><span class="token operator">:</span>
                AccountingVoucher vd2 <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">AccountingVoucher</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                vd2<span class="token punctuation">.</span><span class="token function">setTeamCount</span><span class="token punctuation">(</span>teamCount<span class="token punctuation">)</span><span class="token punctuation">;</span>
                vd2<span class="token punctuation">.</span><span class="token function">setPeriod</span><span class="token punctuation">(</span>period<span class="token punctuation">)</span><span class="token punctuation">;</span>
                vd2<span class="token punctuation">.</span><span class="token function">setSubstract</span><span class="token punctuation">(</span>content<span class="token punctuation">)</span><span class="token punctuation">;</span>
                vd2<span class="token punctuation">.</span><span class="token function">setAcode</span><span class="token punctuation">(</span>myCode<span class="token punctuation">)</span><span class="token punctuation">;</span>
                vd2<span class="token punctuation">.</span><span class="token function">setAname</span><span class="token punctuation">(</span>myCode<span class="token punctuation">)</span><span class="token punctuation">;</span>
                vd2<span class="token punctuation">.</span><span class="token function">setMoneyD</span><span class="token punctuation">(</span>BigDecimal<span class="token punctuation">.</span><span class="token function">valueOf</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                vd2<span class="token punctuation">.</span><span class="token function">setMoneyC</span><span class="token punctuation">(</span>myMoneyD<span class="token punctuation">)</span><span class="token punctuation">;</span>
                BaseBeanHelper<span class="token punctuation">.</span><span class="token function">insert</span><span class="token punctuation">(</span>vd2<span class="token punctuation">)</span><span class="token punctuation">;</span>
                AccountingVoucherMapper<span class="token punctuation">.</span><span class="token function">insert</span><span class="token punctuation">(</span>vd2<span class="token punctuation">)</span><span class="token punctuation">;</span>
                netMoney<span class="token operator">=</span> netMoney<span class="token punctuation">.</span><span class="token function">subtract</span><span class="token punctuation">(</span>myMoneyD<span class="token punctuation">)</span><span class="token punctuation">;</span>
                <span class="token keyword">break</span><span class="token punctuation">;</span>
            <span class="token keyword">case</span> <span class="token string">"其它支出"</span><span class="token operator">:</span>
                AccountingVoucher vd3 <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">AccountingVoucher</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                vd3<span class="token punctuation">.</span><span class="token function">setTeamCount</span><span class="token punctuation">(</span>teamCount<span class="token punctuation">)</span><span class="token punctuation">;</span>
                vd3<span class="token punctuation">.</span><span class="token function">setPeriod</span><span class="token punctuation">(</span>period<span class="token punctuation">)</span><span class="token punctuation">;</span>
                vd3<span class="token punctuation">.</span><span class="token function">setSubstract</span><span class="token punctuation">(</span>content<span class="token punctuation">)</span><span class="token punctuation">;</span>
                vd3<span class="token punctuation">.</span><span class="token function">setAcode</span><span class="token punctuation">(</span>myCode<span class="token punctuation">)</span><span class="token punctuation">;</span>
                vd3<span class="token punctuation">.</span><span class="token function">setAname</span><span class="token punctuation">(</span>myCode<span class="token punctuation">)</span><span class="token punctuation">;</span>
                vd3<span class="token punctuation">.</span><span class="token function">setMoneyD</span><span class="token punctuation">(</span>BigDecimal<span class="token punctuation">.</span><span class="token function">valueOf</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                vd3<span class="token punctuation">.</span><span class="token function">setMoneyC</span><span class="token punctuation">(</span>myMoneyD<span class="token punctuation">)</span><span class="token punctuation">;</span>
                BaseBeanHelper<span class="token punctuation">.</span><span class="token function">insert</span><span class="token punctuation">(</span>vd3<span class="token punctuation">)</span><span class="token punctuation">;</span>
                AccountingVoucherMapper<span class="token punctuation">.</span><span class="token function">insert</span><span class="token punctuation">(</span>vd3<span class="token punctuation">)</span><span class="token punctuation">;</span>
                netMoney<span class="token operator">=</span> netMoney<span class="token punctuation">.</span><span class="token function">subtract</span><span class="token punctuation">(</span>myMoneyD<span class="token punctuation">)</span><span class="token punctuation">;</span>
                <span class="token keyword">break</span><span class="token punctuation">;</span>
            <span class="token keyword">case</span> <span class="token string">"折旧"</span><span class="token operator">:</span>
                netMoney<span class="token operator">=</span> netMoney<span class="token punctuation">.</span><span class="token function">subtract</span><span class="token punctuation">(</span>myMoneyC<span class="token punctuation">)</span><span class="token punctuation">;</span>  <span class="token comment" spellcheck="true">//计算利润的时候要扣减一个折旧科目的贷方发生额。</span>
                <span class="token keyword">break</span><span class="token punctuation">;</span>


        <span class="token punctuation">}</span>

        <span class="token keyword">if</span><span class="token punctuation">(</span>netMoney<span class="token punctuation">.</span><span class="token function">compareTo</span><span class="token punctuation">(</span>BigDecimal<span class="token punctuation">.</span><span class="token function">valueOf</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token operator">==</span> <span class="token number">1</span><span class="token punctuation">)</span> <span class="token comment" spellcheck="true">//当毛利大于零的时候</span>
        <span class="token punctuation">{</span>
            taxMoney <span class="token operator">=</span>  netMoney<span class="token punctuation">.</span><span class="token function">multiply</span><span class="token punctuation">(</span>BigDecimal<span class="token punctuation">.</span><span class="token function">valueOf</span><span class="token punctuation">(</span><span class="token number">0.25</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">setScale</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">,</span>BigDecimal<span class="token punctuation">.</span>ROUND_DOWN<span class="token punctuation">)</span><span class="token punctuation">;</span>  <span class="token comment" spellcheck="true">//所得税0.25,向下取整。这个BIGDECIMAL的语法真的是够烦的！</span>
            netMoney <span class="token operator">=</span> netMoney<span class="token punctuation">.</span><span class="token function">subtract</span><span class="token punctuation">(</span>taxMoney<span class="token punctuation">)</span><span class="token punctuation">;</span>

            AccountingVoucher vd1 <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">AccountingVoucher</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            vd1<span class="token punctuation">.</span><span class="token function">setTeamCount</span><span class="token punctuation">(</span>teamCount<span class="token punctuation">)</span><span class="token punctuation">;</span>
            vd1<span class="token punctuation">.</span><span class="token function">setPeriod</span><span class="token punctuation">(</span>period<span class="token punctuation">)</span><span class="token punctuation">;</span>
            vd1<span class="token punctuation">.</span><span class="token function">setSubstract</span><span class="token punctuation">(</span>content<span class="token punctuation">)</span><span class="token punctuation">;</span>
            vd1<span class="token punctuation">.</span><span class="token function">setAcode</span><span class="token punctuation">(</span><span class="token string">"应交税金"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            vd1<span class="token punctuation">.</span><span class="token function">setAname</span><span class="token punctuation">(</span><span class="token string">"应交税金"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            vd1<span class="token punctuation">.</span><span class="token function">setMoneyD</span><span class="token punctuation">(</span>BigDecimal<span class="token punctuation">.</span><span class="token function">valueOf</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            vd1<span class="token punctuation">.</span><span class="token function">setMoneyC</span><span class="token punctuation">(</span>taxMoney<span class="token punctuation">)</span><span class="token punctuation">;</span>
            BaseBeanHelper<span class="token punctuation">.</span><span class="token function">insert</span><span class="token punctuation">(</span>vd1<span class="token punctuation">)</span><span class="token punctuation">;</span>
            AccountingVoucherMapper<span class="token punctuation">.</span><span class="token function">insert</span><span class="token punctuation">(</span>vd1<span class="token punctuation">)</span><span class="token punctuation">;</span>

            AccountingVoucher vd2 <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">AccountingVoucher</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            vd2<span class="token punctuation">.</span><span class="token function">setTeamCount</span><span class="token punctuation">(</span>teamCount<span class="token punctuation">)</span><span class="token punctuation">;</span>
            vd2<span class="token punctuation">.</span><span class="token function">setPeriod</span><span class="token punctuation">(</span>period<span class="token punctuation">)</span><span class="token punctuation">;</span>
            vd2<span class="token punctuation">.</span><span class="token function">setSubstract</span><span class="token punctuation">(</span>content<span class="token punctuation">)</span><span class="token punctuation">;</span>
            vd2<span class="token punctuation">.</span><span class="token function">setAcode</span><span class="token punctuation">(</span><span class="token string">"年度净利"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            vd2<span class="token punctuation">.</span><span class="token function">setAname</span><span class="token punctuation">(</span><span class="token string">"年度净利"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            vd2<span class="token punctuation">.</span><span class="token function">setMoneyD</span><span class="token punctuation">(</span>BigDecimal<span class="token punctuation">.</span><span class="token function">valueOf</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            vd2<span class="token punctuation">.</span><span class="token function">setMoneyC</span><span class="token punctuation">(</span>netMoney<span class="token punctuation">)</span><span class="token punctuation">;</span>
            BaseBeanHelper<span class="token punctuation">.</span><span class="token function">insert</span><span class="token punctuation">(</span>vd2<span class="token punctuation">)</span><span class="token punctuation">;</span>
            AccountingVoucherMapper<span class="token punctuation">.</span><span class="token function">insert</span><span class="token punctuation">(</span>vd2<span class="token punctuation">)</span><span class="token punctuation">;</span>

        <span class="token punctuation">}</span><span class="token keyword">else</span> <span class="token keyword">if</span><span class="token punctuation">(</span>netMoney<span class="token punctuation">.</span><span class="token function">compareTo</span><span class="token punctuation">(</span>BigDecimal<span class="token punctuation">.</span><span class="token function">valueOf</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token operator">==</span> <span class="token operator">-</span><span class="token number">1</span><span class="token punctuation">)</span> <span class="token comment" spellcheck="true">//当毛利小于零的时候，</span>
        <span class="token punctuation">{</span>

            AccountingVoucher vd2<span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">AccountingVoucher</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            vd2<span class="token punctuation">.</span><span class="token function">setTeamCount</span><span class="token punctuation">(</span>teamCount<span class="token punctuation">)</span><span class="token punctuation">;</span>
            vd2<span class="token punctuation">.</span><span class="token function">setPeriod</span><span class="token punctuation">(</span>period<span class="token punctuation">)</span><span class="token punctuation">;</span>
            vd2<span class="token punctuation">.</span><span class="token function">setSubstract</span><span class="token punctuation">(</span>content<span class="token punctuation">)</span><span class="token punctuation">;</span>
            vd2<span class="token punctuation">.</span><span class="token function">setAcode</span><span class="token punctuation">(</span><span class="token string">"年度净利"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            vd2<span class="token punctuation">.</span><span class="token function">setAname</span><span class="token punctuation">(</span><span class="token string">"年度净利"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            vd2<span class="token punctuation">.</span><span class="token function">setMoneyD</span><span class="token punctuation">(</span>netMoney<span class="token punctuation">.</span><span class="token function">abs</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>  <span class="token comment" spellcheck="true">//毛利为负，计借方，取计算金额的绝对值</span>
            vd2<span class="token punctuation">.</span><span class="token function">setMoneyC</span><span class="token punctuation">(</span>BigDecimal<span class="token punctuation">.</span><span class="token function">valueOf</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            BaseBeanHelper<span class="token punctuation">.</span><span class="token function">insert</span><span class="token punctuation">(</span>vd2<span class="token punctuation">)</span><span class="token punctuation">;</span>
            AccountingVoucherMapper<span class="token punctuation">.</span><span class="token function">insert</span><span class="token punctuation">(</span>vd2<span class="token punctuation">)</span><span class="token punctuation">;</span>

        <span class="token punctuation">}</span>

    <span class="token punctuation">}</span>
<span class="token punctuation">}</span></code></pre>
<h2 id="计算现金"><a href="#计算现金" class="headerlink" title="计算现金"></a>计算现金</h2><pre class=" language-java"><code class="language-java"><span class="token keyword">public</span> BigDecimal <span class="token function">sumMoney</span><span class="token punctuation">(</span>String userTeam <span class="token punctuation">,</span><span class="token keyword">int</span> period<span class="token punctuation">,</span>String acode<span class="token punctuation">,</span>String aType<span class="token punctuation">)</span> <span class="token punctuation">{</span>
    BigDecimal myMoney <span class="token operator">=</span> BigDecimal<span class="token punctuation">.</span><span class="token function">valueOf</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    BigDecimal  addMoney <span class="token operator">=</span> BigDecimal<span class="token punctuation">.</span><span class="token function">valueOf</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">;</span>

    Example example <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Example</span><span class="token punctuation">(</span>AccountingVoucher<span class="token punctuation">.</span><span class="token keyword">class</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    Example<span class="token punctuation">.</span>Criteria criteria <span class="token operator">=</span> example<span class="token punctuation">.</span><span class="token function">createCriteria</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    criteria<span class="token punctuation">.</span><span class="token function">andEqualTo</span><span class="token punctuation">(</span><span class="token string">"teamCount"</span><span class="token punctuation">,</span> userTeam<span class="token punctuation">)</span><span class="token punctuation">;</span>
    criteria<span class="token punctuation">.</span><span class="token function">andEqualTo</span><span class="token punctuation">(</span><span class="token string">"acode"</span><span class="token punctuation">,</span> acode<span class="token punctuation">)</span><span class="token punctuation">;</span>
    criteria<span class="token punctuation">.</span><span class="token function">andEqualTo</span><span class="token punctuation">(</span><span class="token string">"period"</span><span class="token punctuation">,</span> period<span class="token punctuation">)</span><span class="token punctuation">;</span>
    List<span class="token operator">&lt;</span>AccountingVoucher<span class="token operator">></span> oldRow <span class="token operator">=</span> AccountingVoucherMapper<span class="token punctuation">.</span><span class="token function">selectByExample</span><span class="token punctuation">(</span> example<span class="token punctuation">)</span><span class="token punctuation">;</span>

    <span class="token keyword">for</span><span class="token punctuation">(</span><span class="token keyword">int</span> i<span class="token operator">=</span><span class="token number">1</span><span class="token punctuation">;</span>i<span class="token operator">&lt;</span>oldRow<span class="token punctuation">.</span><span class="token function">size</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>i<span class="token operator">++</span><span class="token punctuation">)</span>
    <span class="token punctuation">{</span>
        <span class="token keyword">if</span><span class="token punctuation">(</span><span class="token string">"借"</span><span class="token punctuation">.</span><span class="token function">equals</span><span class="token punctuation">(</span>aType<span class="token punctuation">)</span> <span class="token operator">&amp;&amp;</span> null <span class="token operator">!=</span>oldRow<span class="token punctuation">.</span><span class="token function">get</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">getMoneyD</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
        <span class="token punctuation">{</span>
            addMoney <span class="token operator">=</span> oldRow<span class="token punctuation">.</span><span class="token function">get</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">getMoneyD</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
        <span class="token keyword">if</span><span class="token punctuation">(</span><span class="token string">"贷"</span><span class="token punctuation">.</span><span class="token function">equals</span><span class="token punctuation">(</span>aType<span class="token punctuation">)</span> <span class="token operator">&amp;&amp;</span> null <span class="token operator">!=</span>oldRow<span class="token punctuation">.</span><span class="token function">get</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">getMoneyC</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span>
        <span class="token punctuation">{</span>
            addMoney <span class="token operator">=</span> oldRow<span class="token punctuation">.</span><span class="token function">get</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">getMoneyC</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
        <span class="token punctuation">}</span>
        myMoney <span class="token operator">=</span> myMoney<span class="token punctuation">.</span><span class="token function">add</span><span class="token punctuation">(</span>addMoney<span class="token punctuation">)</span><span class="token punctuation">;</span>

    <span class="token punctuation">}</span>

    <span class="token keyword">return</span> myMoney<span class="token punctuation">;</span>
<span class="token punctuation">}</span></code></pre>
<p>短期贷款显示与长贷类似</p>
<pre class=" language-javascript"><code class="language-javascript">success<span class="token punctuation">:</span> <span class="token keyword">function</span> <span class="token punctuation">(</span>data<span class="token punctuation">)</span> <span class="token punctuation">{</span>
            data <span class="token operator">=</span> data<span class="token punctuation">[</span><span class="token string">'data'</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
            $<span class="token punctuation">.</span><span class="token function">each</span><span class="token punctuation">(</span>data<span class="token punctuation">,</span> <span class="token keyword">function</span> <span class="token punctuation">(</span>n<span class="token punctuation">,</span> value<span class="token punctuation">)</span> <span class="token punctuation">{</span>
                <span class="token keyword">var</span> currentAp <span class="token operator">=</span> <span class="token function">$</span><span class="token punctuation">(</span><span class="token string">"#currentAp"</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">val</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
                <span class="token keyword">var</span> i <span class="token operator">=</span> <span class="token number">1</span> <span class="token operator">+</span> currentAp <span class="token operator">*</span> <span class="token number">1</span> <span class="token operator">-</span> value<span class="token punctuation">.</span>period<span class="token punctuation">;</span>
                console<span class="token punctuation">.</span><span class="token function">log</span><span class="token punctuation">(</span>i<span class="token punctuation">)</span><span class="token punctuation">;</span>
                <span class="token function">$</span><span class="token punctuation">(</span><span class="token string">"#ceo-cz-d"</span> <span class="token operator">+</span> i<span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">val</span><span class="token punctuation">(</span>value<span class="token punctuation">.</span>moneyTotal<span class="token punctuation">)</span><span class="token punctuation">;</span>
            <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</code></pre>
<h2 id="方法汇总"><a href="#方法汇总" class="headerlink" title="方法汇总"></a>方法汇总</h2><h3 id="插入数据"><a href="#插入数据" class="headerlink" title="插入数据"></a>插入数据</h3><pre class=" language-java"><code class="language-java">AccountingVoucher vd1 <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">AccountingVoucher</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            vd1<span class="token punctuation">.</span><span class="token function">setTeamCount</span><span class="token punctuation">(</span>teamCount<span class="token punctuation">)</span><span class="token punctuation">;</span>
            vd1<span class="token punctuation">.</span><span class="token function">setPeriod</span><span class="token punctuation">(</span>period<span class="token punctuation">)</span><span class="token punctuation">;</span>
            vd1<span class="token punctuation">.</span><span class="token function">setSubstract</span><span class="token punctuation">(</span>content<span class="token punctuation">)</span><span class="token punctuation">;</span>
            vd1<span class="token punctuation">.</span><span class="token function">setAcode</span><span class="token punctuation">(</span><span class="token string">"应交税金"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            vd1<span class="token punctuation">.</span><span class="token function">setAname</span><span class="token punctuation">(</span><span class="token string">"应交税金"</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            vd1<span class="token punctuation">.</span><span class="token function">setMoneyD</span><span class="token punctuation">(</span>BigDecimal<span class="token punctuation">.</span><span class="token function">valueOf</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
            vd1<span class="token punctuation">.</span><span class="token function">setMoneyC</span><span class="token punctuation">(</span>taxMoney<span class="token punctuation">)</span><span class="token punctuation">;</span>
            BaseBeanHelper<span class="token punctuation">.</span><span class="token function">insert</span><span class="token punctuation">(</span>vd1<span class="token punctuation">)</span><span class="token punctuation">;</span>
            AccountingVoucherMapper<span class="token punctuation">.</span><span class="token function">insert</span><span class="token punctuation">(</span>vd1<span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
<h3 id="删除数据"><a href="#删除数据" class="headerlink" title="删除数据"></a>删除数据</h3><pre class=" language-java"><code class="language-java"><span class="token comment" spellcheck="true">//删除已有分录按(teamCount period substract)</span>
Example example <span class="token operator">=</span> <span class="token keyword">new</span> <span class="token class-name">Example</span><span class="token punctuation">(</span>AccountingVoucher<span class="token punctuation">.</span><span class="token keyword">class</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
Example<span class="token punctuation">.</span>Criteria criteria <span class="token operator">=</span> example<span class="token punctuation">.</span><span class="token function">createCriteria</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
criteria<span class="token punctuation">.</span><span class="token function">andEqualTo</span><span class="token punctuation">(</span><span class="token string">"teamCount"</span><span class="token punctuation">,</span>teamCount<span class="token punctuation">)</span><span class="token punctuation">;</span>
criteria<span class="token punctuation">.</span><span class="token function">andEqualTo</span><span class="token punctuation">(</span><span class="token string">"period"</span><span class="token punctuation">,</span> period<span class="token punctuation">)</span><span class="token punctuation">;</span>
criteria<span class="token punctuation">.</span><span class="token function">andEqualTo</span><span class="token punctuation">(</span><span class="token string">"substract"</span><span class="token punctuation">,</span> content<span class="token punctuation">)</span><span class="token punctuation">;</span>
List<span class="token operator">&lt;</span>AccountingVoucher<span class="token operator">></span> oldRow1 <span class="token operator">=</span> AccountingVoucherMapper<span class="token punctuation">.</span><span class="token function">selectByExample</span><span class="token punctuation">(</span>example<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">if</span><span class="token punctuation">(</span>oldRow1<span class="token punctuation">.</span><span class="token function">size</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">></span> <span class="token number">0</span><span class="token punctuation">)</span>
<span class="token punctuation">{</span>
    AccountingVoucherMapper<span class="token punctuation">.</span><span class="token function">deleteByExample</span><span class="token punctuation">(</span>example<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span></code></pre>

            </div>
            <hr/>

            

            <link rel="stylesheet" type="text/css" href="/libs/share/css/share.min.css">

<div id="article-share">
    
    <div class="social-share" data-disabled="qzone, qq, weibo, douban"></div>
    
</div>

<script src="/libs/share/js/social-share.min.js"></script>

            <div class="reprint">
                <p>
                    <span class="reprint-tip">
                        <i class="fa fa-exclamation-circle"></i>&nbsp;&nbsp;Reprint please specify:
                    </span>
                    <a href="http://raki0101.github.io" class="b-link-green">Raki</a>
                    <i class="fa fa-angle-right fa-lg fa-fw text-color"></i>
                    <a href="/2020/02/24/Springboot/" class="b-link-green">Springboot</a>
                </p>
            </div>
        </div>
    </div>

    

    

    

    

    

    

<article id="prenext-posts" class="prev-next articles">
    <div class="row article-row">
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge left-badge text-color">
                <i class="fa fa-chevron-left"></i>&nbsp;Previous</div>
            <div class="card">
                <a href="/2020/02/25/ComputerScience/MybatiseCURD/">
                    <div class="card-image">
                        
                        
                        <img src="/medias/featureimages/16.jpg" class="responsive-img" alt="MybatiseCURD">
                        
                        <span class="card-title">MybatiseCURD</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary">Mybatise申明：转载博客–来自 https://blog.csdn.net/biandous/article/details/65630783
查询数据① selectByPrimaryKey()
User user = XxxMap</div>
                    <div class="publish-info">
                        <span class="publish-date">
                            <i class="fa fa-clock-o fa-fw icon-date"></i>2020-02-25
                        </span>
                        <span class="publish-author">
                            
                            <i class="fa fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/categories/%E5%AD%97%E5%85%B8/" class="post-category" target="_blank">
                                    字典
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/tags/%E6%9F%A5%E9%98%85/" target="_blank">
                        <span class="chip bg-color">查阅</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge right-badge text-color">
                Next&nbsp;<i class="fa fa-chevron-right"></i>
            </div>
            <div class="card">
                <a href="/2020/02/24/Finance/ProjectEvaluation/">
                    <div class="card-image">
                        
                        
                        <img src="/medias/featureimages/15.jpg" class="responsive-img" alt="Project Evaluation">
                        
                        <span class="card-title">Project Evaluation</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary">Project Evaluation–收益NPVNPV====Relevant Cash flow。

  Relevant cash flow means that any cash flow will not inflow or out</div>
                    <div class="publish-info">
                            <span class="publish-date">
                                <i class="fa fa-clock-o fa-fw icon-date"></i>2020-02-24
                            </span>
                        <span class="publish-author">
                            
                            <i class="fa fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/categories/Finance/" class="post-category" target="_blank">
                                    Finance
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/tags/FM/" target="_blank">
                        <span class="chip bg-color">FM</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
    </div>
</article>
</div>


<script>
    $('#articleContent').on('copy', function (e) {
        // IE8 or earlier browser is 'undefined'
        if (typeof window.getSelection === 'undefined') return;

        var selection = window.getSelection();
        // if the selection is short let's not annoy our users.
        if (('' + selection).length < Number.parseInt('50')) {
            return;
        }

        // create a div outside of the visible area and fill it with the selected text.
        var bodyElement = document.getElementsByTagName('body')[0];
        var newdiv = document.createElement('div');
        newdiv.style.position = 'absolute';
        newdiv.style.left = '-99999px';
        bodyElement.appendChild(newdiv);
        newdiv.appendChild(selection.getRangeAt(0).cloneContents());

        // we need a <pre> tag workaround.
        // otherwise the text inside "pre" loses all the line breaks!
        if (selection.getRangeAt(0).commonAncestorContainer.nodeName === 'PRE') {
            newdiv.innerHTML = "<pre>" + newdiv.innerHTML + "</pre>";
        }

        var url = document.location.href;
        newdiv.innerHTML += '<br />'
            + 'From: Raki<br />'
            + 'Author: Junhao<br />'
            + 'Link: <a href="' + url + '">' + url + '</a><br />'
            + '本文章著作权归作者所有，任何形式的转载都请注明出处。';

        selection.selectAllChildren(newdiv);
        window.setTimeout(function () {bodyElement.removeChild(newdiv);}, 200);
    });
</script>

    </div>
    <div class="col l3 hide-on-med-and-down">
        <div class="toc-widget">
            <div class="toc-title"><i class="fa fa-list-alt"></i>&nbsp;&nbsp;TOC</div>
            <div id="toc-content"></div>
        </div>
    </div>
</div>

<script src="/libs/tocbot/tocbot.min.js"></script>
<script>
    $(function () {
        tocbot.init({
            tocSelector: '#toc-content',
            contentSelector: '#articleContent',
            headingsOffset: -($(window).height() * 0.4 - 45),
            // headingsOffset: -205,
            headingSelector: 'h2, h3, h4'
        });

        // modify the toc link href to support Chinese.
        let i = 0;
        let tocHeading = 'toc-heading-';
        $('#toc-content a').each(function () {
            $(this).attr('href', '#' + tocHeading + (++i));
        });

        // modify the heading title id to support Chinese.
        i = 0;
        $('#articleContent').children('h2, h3, h4').each(function () {
            $(this).attr('id', tocHeading + (++i));
        });

        // Set scroll toc fixed.
        let tocHeight = parseInt($(window).height() * 0.4 - 64);
        let $tocWidget = $('.toc-widget');
        $(window).scroll(function () {
            let scroll = $(window).scrollTop();
            /* add post toc fixed. */
            if (scroll > tocHeight) {
                $tocWidget.addClass('toc-fixed');
            } else {
                $tocWidget.removeClass('toc-fixed');
            }
        });
    });
</script>
    

</main>


<footer class="page-footer bg-color">
    <div class="container row center-align">
        <div class="col s12 m8 l8 copy-right">
            本站由&copy;<a href="https://blinkfox.github.io/" target="_blank">Blinkfox</a>基于
            <a href="https://hexo.io/" target="_blank">Hexo</a> 的
            <a href="https://github.com/blinkfox/hexo-theme-matery" target="_blank">hexo-theme-matery</a>主题搭建.

            
                &nbsp;<i class="fa fa-area-chart"></i>&nbsp;站点总字数:&nbsp;
                <span class="white-color">2.8k</span>
            

            
			
                <br>
                
                <span id="busuanzi_container_site_pv">
                    <i class="fa fa-heart-o"></i>
                    本站总访问量 <span id="busuanzi_value_site_pv" class="white-color"></span>
                </span>
                
                
                <span id="busuanzi_container_site_uv">
                    <i class="fa fa-users"></i>
                    次,&nbsp;访客数 <span id="busuanzi_value_site_uv" class="white-color"></span> 人.
                </span>
                
            
        </div>
        <div class="col s12 m4 l4 social-link social-statis">


    <a href="mailto:raki0101@163.com" class="tooltipped" target="_blank" data-tooltip="邮件联系我" data-position="top" data-delay="50">
        <i class="fa fa-envelope-open"></i>
    </a>



    <a href="tencent://AddContact/?fromId=50&fromSubId=1&subcmd=all&uin=1460267552" class="tooltipped" data-tooltip="QQ联系我: 1460267552" data-position="top" data-delay="50">
        <i class="fa fa-qq"></i>
    </a>


</div>
    </div>
</footer>

<div class="progress-bar"></div>


<!-- 搜索遮罩框 -->
<div id="searchModal" class="modal">
    <div class="modal-content">
        <div class="search-header">
            <span class="title"><i class="fa fa-search"></i>&nbsp;&nbsp;Search</span>
            <input type="search" id="searchInput" name="s" placeholder="Please enter a search keyword"
                   class="search-input" autofocus="">
        </div>
        <div id="searchResult"></div>
    </div>
</div>

<script src="/js/search.js"></script>
<script type="text/javascript">
    searchFunc("/" + "search.xml", 'searchInput', 'searchResult');
</script>
<!-- 回到顶部按钮 -->
<div id="backTop" class="top-scroll">
    <a class="btn-floating btn-large waves-effect waves-light" href="#!">
        <i class="fa fa-angle-up"></i>
    </a>
</div>


<script src="/libs/materialize/js/materialize.min.js"></script>
<script src="/libs/masonry/masonry.pkgd.min.js"></script>
<script src="/libs/aos/aos.js"></script>
<script src="/libs/scrollprogress/scrollProgress.min.js"></script>
<script src="/libs/lightGallery/js/lightgallery-all.min.js"></script>
<script src="/js/matery.js"></script>

<!-- Global site tag (gtag.js) - Google Analytics -->



    <script src="/libs/others/clicklove.js"></script>


    <script async src="/libs/others/busuanzi.pure.mini.js"></script>


</body>
</html>